import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseTimeEntity } from '@/common/entities/base-time.entity';
import { TABLE_PREFIX } from '@/config';

@Entity({name:`${TABLE_PREFIX}sys_dict`})
export class Dict extends BaseTimeEntity {
    @PrimaryGeneratedColumn()
    id: number;
    
    @Column({ type: "varchar", comment: "字典名称", nullable: true })
    name: string;
    
    @Column({ type: "varchar", comment: "字典编号", nullable: true })
    code: string;
    
    @Column({ type: "int", comment: "字典排序", default: 0 })
    sort: number;
    
    @Column({ type: "int", comment: "父亲id", default: -1 })//默认为-1 ，-1就是代表顶级
    parentId: number;
    
    @Column({ type: "int", comment: "字段的值", default: -999 })
    dictKey: number;
    
    @Column({ type: "varchar", comment: "字段的名称", nullable: true })
    dictValue: string;
    
    @Column({ type: "varchar", comment: "备注", nullable: true })
    remark: string;
}
